package com.sxxm.qxgl.controller;


import com.sxxm.qxgl.dto.OperateBo;
import com.sxxm.qxgl.dto.cx;
import com.sxxm.qxgl.entity.SysDept;
import com.sxxm.qxgl.entity.SysRole;
import com.sxxm.qxgl.service.SysDeptService;
import com.sxxm.qxgl.service.SysRoleService;
import com.sxxm.qxgl.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 部门表 前端控制器
 * </p>
 *
 * @author qjw
 * @since 2021-09-14
 */
@RestController
@Api(value = "部门", tags = "部门")
@RequestMapping("/sys-dept")
public class SysDeptController {
    public SysDeptService sysDeptService;
    public SysDeptController(SysDeptService sysDeptService){
        this.sysDeptService=sysDeptService;
    }

    @ApiOperation("查询")
    @PostMapping("/cx")
    public Result cx(@RequestBody SysDept sysRole){
        return sysDeptService.cx(sysRole);
    }
    @ApiOperation("修改")
    @PostMapping("/ModifyThe")
    public Result ModifyThe(@RequestBody SysDept sysUser){
        return sysDeptService.ModifyThe(sysUser);
    }
    @ApiOperation("添加")
    @PostMapping("/Addition")
    public Result Addition(@RequestBody SysDept sysUser){
        return sysDeptService.Addition(sysUser);
    }
    @ApiOperation("删除")
    @PostMapping("/Delete")
    public Result Delete(@RequestBody SysDept sysUser){
        return sysDeptService.Delete(sysUser.getId());
    }
    @ApiOperation("状态")
    @PostMapping("/zt")
    public Result zt(@RequestBody SysDept sysUser){
        return sysDeptService.zt(sysUser.getId());
    }
}

